package com.zt.springcloud;

import com.zt.springcloud.entity.Vo.OrderListVo;
import com.zt.springcloud.factory.RemoteOrderFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author RedReins
 * @version 1.0
 * @description: TODO
 * @date 2021/9/11 21:09
 */

@FeignClient(contextId = "RemoteOrderService",value = "cloud-system",fallbackFactory = RemoteOrderFallbackFactory.class)
public interface RemoteOrderService {
    @RequestMapping(value = "/createOrder",method = RequestMethod.POST)
    Boolean createOrder(@RequestBody String reqData,@RequestParam("userId") Long userId);

    /*
     * 查询用户所有订单
     * */
    @RequestMapping(value = "/orderList",method = RequestMethod.POST)
    public List<OrderListVo> getUserAllOrder(@RequestParam("userId") Long userId);

    /*
     * 删除订单中的商品
     * */
    @RequestMapping(value = "/orderDelete/{orderId}",method = RequestMethod.DELETE)
    Boolean deleteOrderItem(@PathVariable("orderId") String orderId);
}

